/*
 * @Author: laladuduqq
 * @Date: 2024-12-17 19:48:10
 * @LastEditors: laladuduqq
 * @LastEditTime: 2025-01-18 09:56:09
 */
#include "dji.h"
#include "rtdef.h"
#include "rtthread.h"

#define LOG_TAG              "motor_task"
#define LOG_LVL              LOG_LVL_DBG
#include <ulog.h>


static void motortx_thread_entry(void *parameter)
{
    while (1) 
    {        
        DJIMotorControl();
        rt_thread_mdelay(2);
    }
}
int motor_thread_entry_init(void)
{
    rt_err_t ret = RT_EOK;

    rt_thread_t thread = rt_thread_create("motor", motortx_thread_entry, RT_NULL, 2048, 26, 10);
    /* 创建成功则启动线程 */
    if (thread != RT_NULL)
    {
        rt_thread_startup(thread);
    }
    else
    {
        ret = RT_ERROR;
    }

    LOG_D("motor thread init success!\n");

    return ret;
}

INIT_APP_EXPORT(motor_thread_entry_init);
